package com.chuangjiangx.member.basic.ddd.domain.model;

import java.util.Objects;

/**
 * 积分累计规则对象
 */
public enum MbrScoreGrandTotalRuleScope {

    ALL("所有会员",(byte) 0);

    public final String name;
    public final Byte value;

    MbrScoreGrandTotalRuleScope(String name, Byte value) {
        this.name = name;
        this.value = value;
    }

    public static MbrScoreGrandTotalRuleScope getPlusScoreRuleScope(Byte value) {
        for (MbrScoreGrandTotalRuleScope scope : MbrScoreGrandTotalRuleScope.values()) {
            if (Objects.equals(scope.value, value)) {
                return scope;
            }
        }
        return null;
    }
}
